package com.siwei.eqi.util;

import com.siwei.eqi.pojo.entity.GuangdongLandUse;
import com.siwei.eqi.pojo.entity.LandDataEntity;

public class LandDataConverter {


    /**
     * 将 LandDataEntity 转换为 GuangdongLandUse
     *
     * @param entity 标准化的土地数据实体
     * @return 广东省土地利用数据
     */
    public static GuangdongLandUse convertToGuangdongLandUse(LandDataEntity entity) {
        GuangdongLandUse landUse = new GuangdongLandUse();

        // 区划编码 (Region Code)
        landUse.setCode(Integer.parseInt(entity.getRegionCode()));

        // 数据显示名称 (County Name)
        landUse.setCountyName(entity.getDataShowName());

        // 有林地 (Forested Land)
        landUse.setForestedLand(entity.getForestArea());

        // 灌木林地 (Shrubland)
        landUse.setShrubland(entity.getShrubForestArea());

        // 疏林地 (Sparse Forest)
        landUse.setSparseForest(entity.getSparseForestArea());

        // 其它林地 (Other Woodland)
        landUse.setOtherWoodland(entity.getOtherForestArea());

        // 高覆盖度草地 (High Coverage Grassland)
        landUse.setHighCoverageGrassland(entity.getHighCoverageGrasslandArea());

        // 中覆盖度草地 (Medium Coverage Grassland)
        landUse.setMediumCoverageGrassland(entity.getMediumCoverageGrasslandArea());

        // 低覆盖度草地 (Low Coverage Grassland)
        landUse.setLowCoverageGrassland(entity.getLowCoverageGrasslandArea());

        // 河流面积 (River Area)
        landUse.setRiverArea(entity.getRiverArea());

        // 湖泊 (Lake Area)
        landUse.setLakeArea(entity.getLakeArea());

        // 水库坑塘 (Reservoir and Pond Area)
        landUse.setReservoirPondArea(entity.getReservoirPondArea());

        // 永久性冰川雪地 (Permanent Glacier Snow)
        landUse.setPermanentGlacierSnow(entity.getPermanentGlacierSnowArea());

        // 滩涂 (Tidal Flat)
        landUse.setTidalFlat(entity.getTidalFlatArea());

        // 滩地 (Beach Area)
        landUse.setBeachArea(entity.getFloodplainArea());

        // 近岸海域 (Coastal Waters)
        landUse.setCoastalWaters(entity.getCoastalSeaArea());

        // 水田 (Paddy Field)
        landUse.setPaddyField(entity.getPaddyFieldArea());

        // 旱地 (Dry Farmland)
        landUse.setDryFarmland(entity.getDrylandArea());

        // 城市建设用地 (Urban Construction)
        landUse.setUrbanConstruction(entity.getUrbanConstructionArea());

        // 农村居民点 (Rural Residential)
        landUse.setRuralResidential(entity.getRuralSettlementArea());

        // 其它建设用地 (Other Construction)
        landUse.setOtherConstruction(entity.getOtherConstructionArea());

        // 沙地 (Sandy Land)
        landUse.setSandyLand(entity.getSandyArea());

        // 戈壁 (Gobi Desert)
        landUse.setGobi(entity.getGobiArea());

        // 盐碱地 (Saline-Alkali Land)
        landUse.setSalineAlkaliLand(entity.getSalineAlkaliLandArea());

        // 沼泽地 (Marshland)
        landUse.setMarshland(entity.getSwampArea());

        // 裸土地 (Bare Land)
        landUse.setBareLand(entity.getBareLandArea());

        // 裸岩石砾 (Bare Rock and Gravel)
        landUse.setBareRockGravel(entity.getBareRockGravelArea());

        // 其它 (Others)
        landUse.setOthersArea(entity.getOtherArea());

        return landUse;
    }
}
